#include "hun.h"
#include "ui_hun.h"

Hun::Hun(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Hun)
{
    ui->setupUi(this);
}

Hun::~Hun()
{
    delete ui;
}

std::string a1,b1;
double a,b,c;
void Hun::on_hunconfirm_clicked()
{
    Adate=ui->adate->text();
    Bdate=ui->Bdate->text();
    a1=Adate.toStdString();
    b1=Bdate.toStdString();
    a = stod(a1);
    b = stod(b1);
    c=sqrt(a*a+b*b);
    ui->Hunanswer->setText(QString::number(c,10,6));
}


void Hun::on_Bback_clicked()
{
    this->hide();
    MainWindow *n=new MainWindow;
    n->show();
}

